const express = require('express')
const app = express()

app.get('/', async (req, res, next) => {
  res.send('get /')
})

app.get('/foo', async (req, res, next) => {
  res.send('get /foo')
})

app.get('/bar', async (req, res, next) => {
  res.send('get /bar')
})

// 处理 404 的内容
app.use((req, res, next) => {
  res.status(404).send('404 Not Found.')
})

app.listen(3000, () => {
  console.log(`Server running at http://localhost:3000/`)
})
